home *** CD-ROM | disk | FTP | other *** search
/ NeXTSTEP 3.3 (Developer)…68k, x86, SPARC, PA-RISC] / NeXTSTEP 3.3 Dev Intel.iso / usr / sybase / doc / dbalttype.man < prev    next >
Text File  |  1993-04-22  |  3KB  |  111 lines

  1.  
  2.   1                       Version 4.0 -- 5/1/89                dbalttype
  3.   ______________________________________________________________________
  4.  
  5.   NAME:  dbalttype
  6.  
  7.   FUNCTION:
  8.        Return the datatype for a compute column.
  9.  
  10.   SYNTAX:
  11.        int dbalttype(dbproc, computeid, column)
  12.  
  13.        DBPROCESS *dbproc;
  14.        int       computeid;
  15.        int       column;
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.   dbalttype               Version 4.0 -- 5/1/89                        2
  25.   ______________________________________________________________________
  26.  
  27.   COMMENTS:
  28.  
  29.        o This routine returns the datatype for a compute column.  For  a
  30.          list of SQL Server datatypes, see the manual page for types.
  31.        o dbalttype() actually returns an integer  token  value  for  the
  32.          datatype  (SYBCHAR, SYBFLT8, etc.).  To convert the token value
  33.          into  a  readable  token  string,  use  dbprtype().   See   the
  34.          dbprtype() manual page for a list of all token values and their
  35.          equivalent token strings.
  36.  
  37.        o For example, given the SQL statement:
  38.  
  39.               select dept, name from employee
  40.                 order by dept, name
  41.                 compute count(name) by dept
  42.  
  43.          the call dbalttype(dbproc, 1, 1) will return  the  token  value
  44.  
  45.  
  46.   3                       Version 4.0 -- 5/1/89                dbalttype
  47.   ______________________________________________________________________
  48.          SYBINT4, because counts are of SYBINT4 type.   dbprtype()  will
  49.          convert SYBINT4 into the readable token string "int".
  50.  
  51.   PARAMETERS:
  52.        dbproc -  A pointer to the DBPROCESS structure that provides  the
  53.            connection for a particular front end/SQL Server process.  It
  54.            contains all the information that DB-Library uses  to  manage
  55.            communications and data between the front end and SQL Server.
  56.        computeid -  The id that identifies the particular compute row of
  57.            interest.   A  SQL SELECT statement may have multiple COMPUTE
  58.            clauses, each of which returns a separate compute  row.   The
  59.            computeid  corresponding  to  the  first  COMPUTE clause in a
  60.            SELECT is 1.  The computeid is  returned  by  dbnextrow()  or
  61.            dbgetrow().
  62.        column -  The number of the column of interest.  The first column
  63.            is number 1.
  64.  
  65.  
  66.  
  67.  
  68.   dbalttype               Version 4.0 -- 5/1/89                        4
  69.   ______________________________________________________________________
  70.  
  71.   RETURNS:
  72.        A token value for the datatype for a particular compute column.
  73.  
  74.        In a few cases, the token value returned by this routine may  not
  75.        correspond exactly with the column's SQL Server datatype:
  76.        o SYBVARCHAR is returned as SYBCHAR.
  77.  
  78.        o SYBVARBINARY is returned as SYBBINARY.
  79.        o SYBDATETIMN is returned as SYBDATETIME.
  80.  
  81.        o SYBMONEYN is returned as SYBMONEY.
  82.        o SYBFLTN is returned as SYBFLT8.
  83.  
  84.        o SYBINTN is returned as SYBINT1, SYBINT2, or SYBINT4,  depending
  85.          on the actual type of the SYBINTN.
  86.       dbalttype() returns -1 if either the computeid or the  column  are
  87.  
  88.  
  89.  
  90.   5                       Version 4.0 -- 5/1/89                dbalttype
  91.   ______________________________________________________________________
  92.       invalid.
  93.  
  94.   SEE ALSO:
  95.        dbadata, dbadlen, dbaltlen, dbnextrow, dbnumalts, dbprtype, types
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.